<?php
if($photos)
{
    foreach ($photos as $value) 
    {
    ?>
    <li>
                    	<div class="bgphoto">
                        	<a href="#"><img src="<?php echo $value;?>" alt="" /></a>
                        </div>
                        
                    </li>
    <?php 
    }
} 
?>